package com.tongqin.distributed;

import com.tongqin.distributed.api.IZsHello;

import java.util.Random;
import java.util.ServiceLoader;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) {
        System.out.println("Hello World!");

        ServiceLoader<IZsHello> service = ServiceLoader.load(IZsHello.class);
        for (IZsHello hello : service) {
            Random random = new Random();
            System.out.println(hello.sayHello("八戒"+random.nextInt(10)));

        }

    }
}
